package cn.school.service;

import cn.school.dao.AdminDao;
import cn.school.entity.Admin;
import cn.school.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class AdminService {
    public static final AdminService INST=new AdminService();
    public Admin login(String u, String p) {
        SqlSession s = MyBatisUtil.get();
        try {
            AdminDao dao = s.getMapper(AdminDao.class);
            return dao.login(u,p);
        } finally {
            MyBatisUtil.close(s);
        }
    }
}
